package com.bcs.moon;

import java.util.Hashtable;

public class Scope {
	public Scope previous;
	public Hashtable<String, Integer> lookup = new Hashtable<String, Integer>();;
	public StackFrame frame;
	
	public Scope(StackFrame frame, Scope previous) {
		this.frame = frame;
		this.previous = previous;
	}
	
	public void addLocal(String name, int slot) {
		lookup.put(name, slot);
	}
	
	public Integer getName(String name) {
		return lookup.get(name);
	}
}
